/**
 * http请求模块
 */
import axios from 'axios'

export async function request (data) {
  const conf = {
    headers: {
      // Authorization: "token"
    },
    ...data
  }
  return await axios(conf)
}

export function getaxios(url, data) {
    if (data["token"] == "undefined" || data["token"] == "(null)" || data["token"] == "null") {
        data["token"] = ""
    }
    var VALUE = true;

    for (var k in data) {
        if (!data[k] || data[k] == undefined || data[k] == "undefined" || data[k] == "null" || data[k] == "(null)") {
            data[k] = "";
        }
    }
    console.log(url)
    return axios.get(url, {
        params: data
    }).then(function (res) {
        return Promise.resolve(res.data);
    }).catch(function (err) {
        return err;
    });
}